home *** CD-ROM | disk | FTP | other *** search
/ Wildcat Gold - The Optical BBS / Wildcat Gold - The Optical BBS (The Golden ROM Series)(Volume 4 Number 1)(The Digital Publishing Company)(1992).ISO / sdn / nonlin10.sdn / NONLIN.DOC < prev    next >
Text File  |  1992-01-05  |  58KB  |  1,224 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.                                     N O N L I N
  10.  
  11.  
  12.  
  13.                        Nonlinear Regression Analysis Program
  14.  
  15.                                     Version 1.0
  16.  
  17.  
  18.  
  19.                                 Phillip H. Sherrod
  20.  
  21.                                A "shareware" program
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.               Nonlin  allows  you  to  perform regression analyses to
  29.               estimate  the  values   of   parameters   for   linear,
  30.               multivariate,   polynomial,   and   general   nonlinear
  31.               functions.   The  regression  analysis  determines  the
  32.               values  of  the  parameters which cause the function to
  33.               best fit the observed data that you  provide.    Nonlin
  34.               allows you to specify the function whose parameters are
  35.               being estimated  using ordinary algebraic notation.  In
  36.               addition to determining the parameter estimates, Nonlin
  37.               can  be  directed  to  generate  an  output  file  with
  38.               predicted values  and  residuals.  It can also plot the
  39.               data observations and the computed function.
  40.  
  41.                NONLIN -- Nonlinear Regression Program       Page 1
  42.  
  43.  
  44.  
  45.  
  46.          INTRODUCTION TO REGRESSION ANALYSIS
  47.  
  48.          The  goal  of  regression  analysis  is  to  determine  the  best
  49.          estimates of parameters for a function
  50.  
  51.          depvar = f(p,indepvar)
  52.  
  53.          where `depvar' is the dependent variable, `indepvar'  is  one  or
  54.          more  independent  variables,  and  `p' is one or more parameters
  55.          whose values are to be estimated.    In  linear  regression,  the
  56.          function, f, is a linear (straight line) equation.
  57.  
  58.          For example, if we assume the value of an automobile decreases by
  59.          a constant amount each year after its purchase, and for each mile
  60.          driven,  the  following  linear  function would predict its value
  61.          (the dependent variable) as a function  of  the  two  independent
  62.          variables which are age and miles:
  63.  
  64.          value = price + depage*age + depmiles*miles
  65.  
  66.          where  `value',  the dependent variable, is the value of the car,
  67.          `age' is the age of the car, and `miles' is the number  of  miles
  68.          that the car has been driven.
  69.  
  70.          The  regression  analysis  will  determine the best values of the
  71.          three parameters, `price', the estimated value  when  age  is  0,
  72.          `depage',  the  depreciation  that  takes  place  each  year, and
  73.          `depmiles', the depreciation for each mile driven.  The values of
  74.          `depage' and `depmiles' will be negative because  the  car  loses
  75.          value as time and miles increase.
  76.  
  77.          In  a  problem  such  as  this car depreciation example, you must
  78.          provide a data file containing the values of  the  dependent  and
  79.          independent variables for a set of observations.  In this example
  80.          each  observation record would contain three numbers: value, age,
  81.          and miles, collected from used car ads for the  same  model  car.
  82.          The  more observations you provide, the more accurate will be the
  83.          estimate of the parameters.
  84.  
  85.          Once the values of the parameters are estimated, you can use  the
  86.          formula  to predict the value of a car based on its age and miles
  87.          driven.  If a perfect fit existed between the  function  and  the
  88.          actual data, the actual value of each car in your data file would
  89.  
  90.                NONLIN -- Nonlinear Regression Program       Page 2
  91.  
  92.  
  93.          exactly equal  the  predicted value.  Typically, however, this is
  94.          not  the case, and the difference between the actual value of the
  95.          dependent variable and  its  predicted  value  for  a  particular
  96.          observation  is  the  error of the estimate which is known as the
  97.          "deviation" or "residual".  The goal of regression analysis is to
  98.          determine the values of the parameters which minimize the sum  of
  99.          the squared residual values for the set of observations.  This is
  100.          known as a "least squares" regression fit.
  101.  
  102.  
  103.          INTRODUCTION TO NONLIN
  104.  
  105.          Nonlin is  a very powerful regression analysis program.  Using it
  106.          you can perform multivariate,  linear,  polynomial,  and  general
  107.          nonlinear regression.    What  this means is that you specify the
  108.          form of the function to be fitted to the data, and  the  function
  109.          can  include  nonlinear  terms such as variables raised to powers
  110.          and library  functions  such  as  log,  exponential,  sine,  etc.
  111.          Nonlin uses a state-of-the-art regression algorithm that works as
  112.          well,  or  better,  than any you are likely to find in commercial
  113.          statistical packages.
  114.  
  115.          As  an  example  of  nonlinear   regression,   consider   another
  116.          depreciation problem.  The value of a used airplane decreases for
  117.          each year of its age.  Assuming the value of a plane falls by the
  118.          same  amount  each  year, a linear function relating value to age
  119.          is:
  120.  
  121.               Value = p0 + p1*Age
  122.  
  123.          Where `p0' and `p1' are the parameters whose  values  are  to  be
  124.          determined.   However,  it  is a well known fact that planes (and
  125.          automobiles) lose more value the first year than the second,  and
  126.          more the  second  than  the third, etc.  This means that a linear
  127.          (straight line) function cannot accurately model this  situation.
  128.          A better, nonlinear, function is:
  129.  
  130.               Value = p0 + p1*exp(-p2*Age)
  131.  
  132.          Where  the `exp' function is the value of e (2.7182818...) raised
  133.          to a power.    This  type  of  function  is  known  as  "negative
  134.          exponential"  and  is appropriate for modeling a value whose rate
  135.          of decrease is proportional to the difference between  the  value
  136.          and some base value.  The F33YEAR.NLR example command file fits a
  137.          linear function  to  the value of used airplanes.  The F33EXP.NLR
  138.  
  139.                 NONLIN -- Nonlinear Regression Program       Page 3
  140.  
  141.  
  142.          example fits a negative exponential function to  the  same  data.
  143.          Run both  examples  and  compare  the  fitted  functions.     The
  144.          COOLING.NLR example also uses a negative exponential function.
  145.  
  146.          Much  of  the  convenience of Nonlin comes from the fact that you
  147.          can  enter  complicated  functions   using   ordinary   algebraic
  148.          notation.   Examples of functions that can be handled with Nonlin
  149.          include:
  150.  
  151.          Linear: Y = p0 + p1*X
  152.  
  153.          Quadratic: Y = p0 + p1*X + p2*X^2
  154.  
  155.          Multivariate: Y = p0 + p1*X + p2*Z + p3*X*Z
  156.  
  157.          Exponential: Y = p0 + p1*exp(X)
  158.  
  159.          Periodic: Y = p0 + p1*sin(p2*X)
  160.  
  161.          Misc: Y = p0 + p1*Y + p2*exp(Y) + p3*sin(Z)
  162.  
  163.          In other words, the function is a  general  expression  involving
  164.          one  dependent  variable  (on the left of the equal sign), one or
  165.          more independent variables, and  one  or  more  parameters  whose
  166.          values are to be estimated.
  167.  
  168.          Because  of  its  generality,  Nonlin  can  perform  all  of  the
  169.          regressions handled by ordinary linear or multivariate regression
  170.          programs as well as nonlinear regression.  However, in  order  to
  171.          handle  nonlinear  functions,  Nonlin  uses an iterative function
  172.          optimization algorithm which is slower  than  the  simple  linear
  173.          regression  algorithm and has the potential for not converging to
  174.          a solution.
  175.  
  176.  
  177.          INSTALLING NONLIN
  178.  
  179.          The NONLIN system consists of the following files:
  180.  
  181.          NONLIN.EXE -- The executable program.
  182.          NONLIN.DOC -- Documentation file.
  183.          NONLIN.FON -- Font file used if you request a plot.
  184.          NONLIN.LJF -- HP LaserJet font file used if you print a plot.
  185.               *.NLR -- Example command files.
  186.  
  187.                 NONLIN -- Nonlinear Regression Program       Page 4
  188.  
  189.  
  190.          To install Nonlin, copy the files  into  the  directory  of  your
  191.          choice.  If you do not plan to generated hard copy output  for  a
  192.          LaserJet printer,  you  may  delete  the NONLIN.LJF file.  If the
  193.          NONLIN.FON  and  NONLIN.LJF  files  are  not  in   your   current
  194.          directory, you must place a command of the following form in your
  195.          AUTOEXEC.BAT  file  to  tell  Nonlin  where  to look for its font
  196.          files:
  197.  
  198.          SET NONLIN=directory
  199.  
  200.          Where "directory" is the name of the device and  directory  where
  201.          the files  are located.  For example, if the files are located in
  202.          a directory named NONLIN on the C  disk,  the  following  command
  203.          could be used:
  204.  
  205.          SET NONLIN=C:\NONLIN
  206.  
  207.  
  208.          USING NONLIN
  209.  
  210.          Once  Nonlin  has  been  installed, it can be started using a DOS
  211.          command of the form:
  212.  
  213.          NONLIN command_file
  214.  
  215.          where "command_file" is the name  of  a  file  containing  Nonlin
  216.          commands that  control  the  analysis.   The sections that follow
  217.          describe these commands.  If you  omit  the  command  file  name,
  218.          Nonlin prints a list of its commands.
  219.  
  220.          If  you wish to direct the output produced by Nonlin to a file or
  221.          printer, use the DOS  `>'  redirection  operator  on  the  NONLIN
  222.          command line.    For  example,  to  process  a command file named
  223.          LINEAR.NLR, directing output to a file named LINEAR.LST, use  the
  224.          following command:
  225.  
  226.          NONLIN LINEAR > LINEAR.LST
  227.  
  228.          At  this  point,  I  suggest  you  pause  in your reading and try
  229.          running a Nonlin example to get a feel for how it works.  Several
  230.          example files with the extension ".NLR"  are  provided  with  the
  231.          distribution.  LINEAR.NLR is a good one to start with.  If you do
  232.          not  have  a  graphics  monitor, edit the LINEAR.NLR command file
  233.          (and other example files) and remove the PLOT command.
  234.  
  235.                NONLIN -- Nonlinear Regression Program       Page 5
  236.  
  237.  
  238.          FUNCTION SPECIFICATION
  239.  
  240.          Much  of  the  power of Nonlin comes from its ability to estimate
  241.          the value of parameters that are part  of  complicated  functions
  242.          that you enter in ordinary algebraic form.  This section explains
  243.          the  arithmetic operators and built in functions that are used to
  244.          specify a function.
  245.  
  246.          Arithmetic Operators
  247.  
  248.          The following arithmetic operators may be used in expressions:
  249.  
  250.              +        addition
  251.              -        subtraction or unary minus
  252.              *        multiplication
  253.              /        division
  254.              ** or ^  exponentiation
  255.  
  256.          Exponentiation  has   the   highest   precedence,   followed   by
  257.          multiplication  and  division, and then addition and subtraction.
  258.          Parentheses may be used to group terms.
  259.  
  260.          As a convenience, Nonlin allows you to  omit  the  multiplication
  261.          operator  between  a  numeric  constant and a following variable,
  262.          parameter, or function.  For example, the expressions "2pi",  and
  263.          "2 pi" are  equivalent  to "2*pi".  Similarly, "5X" is equivalent
  264.          to "5*X".  However, if you specify a  number  before  the  letter
  265.          "E",  it  will  be taken as the exponential form of a number (see
  266.          below) rather than the number  times  the  constant  E  (base  of
  267.          natural logarithms).
  268.  
  269.          Numeric Constants
  270.  
  271.          Numeric  constants  may  be  written in their natural form (1, 0,
  272.          1.5, .0003, etc.) or in exponential form, n.nnnEppp, where  n.nnn
  273.          is  the  base value and ppp is the power of ten by which the base
  274.          is multiplied.  For example, the number 1.5E4  is  equivalent  to
  275.          15000.   All  numbers  are  treated  as  "floating point" values,
  276.          regardless of whether a decimal point is specified or not.  As  a
  277.          convenience  for entering time values, if a value contains one or
  278.          more colons, the portion to the left of the colon  is  multiplied
  279.          by 60.    For  example,  1:00  is  equivalent  to  60; 1:00:00 is
  280.          equivalent to 3600.
  281.  
  282.                NONLIN -- Nonlinear Regression Program       Page 6
  283.  
  284.  
  285.          Symbolic Constants
  286.  
  287.          There  are  two  numeric  constants  that  may be specified using
  288.          symbolic names.  The symbolic name  "PI"  is  equivalent  to  the
  289.          value of  pi, 3.14159...  Similarly, the symbolic constant "E" is
  290.          equivalent to the base of natural logarithms, 2.7182818...
  291.  
  292.  
  293.          Built in Functions
  294.  
  295.          The following functions are built into Nonlin and may be used  in
  296.          expressions:
  297.  
  298.          ABS(x) -- Absolute value of x.
  299.  
  300.          ACOS(x) -- Arc cosine of x.  Angles are measured in radians.
  301.  
  302.          ASIN(x) -- Arc sine of x.  Angles are measured in radians.
  303.  
  304.          ATAN(x) -- Arc tangent of x.  Angles are measured in radians.
  305.  
  306.          J0(x) -- Bessel function of the first kind, order zero.
  307.  
  308.          J1(x) -- Bessel function of the first kind, order one.
  309.  
  310.          JN(n,x) -- Bessel function of the first kind, order n.
  311.  
  312.          COS(x) -- Cosine of x.  Angles are measured in radians.
  313.  
  314.          COSH(x) -- Hyperbolic cosine of x.
  315.  
  316.          COT(x) -- Cotangent of x. (COT(x) = 1/TAN(x)).
  317.  
  318.          CSC(X) -- Cosecant of x. (CSC(x) = 1/SIN(x)).
  319.  
  320.          DEG(x)  --  Converts  an  angle,  x,  measured  in radians to the
  321.                    equivalent number of degrees.
  322.  
  323.          EXP(x) -- e (base of natural logarithms) raised to the x power.
  324.  
  325.          FAC(x) -- x factorial (x!).  Note, the FAC function  is  computed
  326.                    using   the   GAMMA   function  (FAC(x)=GAMMA(x+1))  so
  327.                    non-integer argument values may be computed.
  328.  
  329.                NONLIN -- Nonlinear Regression Program       Page 7
  330.  
  331.  
  332.          GAMMA(x) -- Gamma function.  Note, GAMMA(x+1) = x! (x factorial).
  333.  
  334.          GAMMAI(x)   --   Reciprocal   of   GAMMA  function  (GAMMAI(x)  =
  335.                    1/GAMMA(x)).
  336.  
  337.          HAV(x) -- Haversine of x. (HAV(x) = (1-COS(x))/2).
  338.  
  339.          LOG(x) -- Natural logarithm of x.
  340.  
  341.          LOG10(x) -- Base 10 logarithm of x.
  342.  
  343.          MAX(x1,x2) -- Maximum value of x1 or x2.
  344.  
  345.          MIN(x1,x2) -- Minimum value of x1 or x2.
  346.  
  347.          NORMAL(x) -- Normal probability distribution of x.  X is in units
  348.                    of standard deviations from the mean.
  349.  
  350.          PULSE(a,x,b) -- Pulse function.  If the value of x is less than a
  351.                    or greater than b, the value of the function is 0.   If
  352.                    x  is greater than or equal to a and less than or equal
  353.                    to b, the value of the function is 1.  In other  words,
  354.                    it is  1  for  the domain (a,b) and zero elsewhere.  If
  355.                    you need a function that is zero in  the  domain  (a,b)
  356.                    and 1 elsewhere, use the expression (1-PULSE(a,x,b)).
  357.  
  358.          RAD(x) -- Converts an angle measured in degrees to the equivalent
  359.                    number of radians.
  360.  
  361.          SEC(x) -- Secant of x. (SEC(x) = 1/COS(x)).
  362.  
  363.          SEL(a1,a2,v1,v2)  --  If a1 is less than a2 then the value of the
  364.                    function is v1.  If a1 is greater than or equal to  a2,
  365.                    then the value of the function is v2.
  366.  
  367.          SIN(x) -- Sine of x.  Angles are measured in radians.
  368.  
  369.          SINH(x) -- Hyperbolic sine of x.
  370.  
  371.          SQRT(x) -- Square root of x.
  372.  
  373.          STEP(a,x) --  Step  function.   If x is less than a, the value of
  374.                    the function is 0.  If x is greater than or equal to a,
  375.                    the value of the function is 1.  If you need a function
  376.                    which is 1 up to a certain value and then 0 beyond that
  377.  
  378.                NONLIN -- Nonlinear Regression Program       Page 8
  379.  
  380.  
  381.                    value, use the expression STEP(x,a).
  382.  
  383.          T(n,x) -- Chebyshev polynomial of order n.
  384.  
  385.          TAN(x) -- Tangent of x.  Angles are measured in radians.
  386.  
  387.          TANH(x) -- Hyperbolic tangent of x.
  388.  
  389.          Y0(x) -- Bessel function of the second kind, order zero.
  390.  
  391.          Y1(x) -- Bessel function of the second kind, order one.
  392.  
  393.          YN(n,x) -- Bessel function of the second kind, order n.
  394.  
  395.                 NONLIN -- Nonlinear Regression Program       Page 9
  396.  
  397.  
  398.          NONLIN COMMAND FILES
  399.  
  400.          The commands described in this section are placed  in  a  command
  401.          file.  When you start Nonlin, you specify the name of the command
  402.          file as  a  parameter  on  the command line.  For example, if the
  403.          command file name is CAR.NLR, the following command  would  cause
  404.          Nonlin to execute the commands in the command file:
  405.  
  406.          NONLIN CAR.NLR
  407.  
  408.          If you do not specify a file name extension for the command file,
  409.          ".NLR" is  used by default.  Command files can be created using a
  410.          text editor such as  EDIT-32,  EDLIN,  the  DOS  version  5  EDIT
  411.          program, or any other editor or word processor that is capable of
  412.          creating an ascii text file without formatting codes.
  413.  
  414.          Comments  may be placed in command files by preceding the comment
  415.          with an exclamation point.  Entire lines may be used for comments
  416.          and comments can be placed at the end of commands.
  417.  
  418.          Command lines can be continued by placing a  semicolon  character
  419.          as the last non-blank character on the line (a comment may follow
  420.          the  semicolon)  and then continuing the command on the following
  421.          line(s).
  422.  
  423.          Every  command  file  must  contain   the   following   commands:
  424.          VARIABLES,  PARAMETERS,  FUNCTION,  and  DATA. The DATA statement
  425.          introduces the data for the analysis and must be the last command
  426.          in the file (data records  may  follow  it).    Other,  optional,
  427.          commands may be interspersed in the command file.
  428.  
  429.          The following is an example of a complete command file:
  430.  
  431.              VARIABLES  VALUE,AGE,MILES
  432.              PARAMETERS BASE,DEPAGE,DEPMILES
  433.              FUNCTION VALUE = BASE + DEPAGE*AGE + DEPMILES*MILES
  434.              DATA
  435.              (data records follow)
  436.  
  437.                 NONLIN -- Nonlinear Regression Program      Page 10
  438.  
  439.  
  440.          NONLIN COMMANDS
  441.  
  442.          The following is a list of the valid Nonlin commands that can  be
  443.          placed in  a  Nonlin  command  file.    Command  keywords  may be
  444.          abbreviated to the first three letters.  Nonlin commands are  not
  445.          case sensitive.
  446.  
  447.          TITLE string (optional) -- Specifies a title line that is printed
  448.                  with the results of the analysis.
  449.  
  450.          VARIABLES var1,var2,...  (required) -- Specifies the names of the
  451.                  variables that  will  be  used  in  the  function.    The
  452.                  dependent  variable and the independent variables must be
  453.                  specified.  The order of the variable  names  must  match
  454.                  the order  of  the data values for each observation.  You
  455.                  may define more variables than you actually  use  in  the
  456.                  function specification.  A maximum of 12 variables may be
  457.                  specified.   The  length of a variable name is limited to
  458.                  10 characters.  Capitalize the variable names as you want
  459.                  them displayed in the results.
  460.  
  461.                  If you wish to assign a weight to  the  observations  (so
  462.                  some  observations  are  considered more significant than
  463.                  others), use $WEIGHT as the name of the weight variable.
  464.  
  465.                  You may specify all of the variables on a single  command
  466.                  line  (which  may be continued), or you may have multiple
  467.                  VARIABLES commands.  If you use  multiple  commands,  the
  468.                  order in which they appear in the command file must match
  469.                  the  order  of  the variable values for each observation.
  470.                  The VARIABLES command must precede the FUNCTION command.
  471.  
  472.          PARAMETERS param1[=initial1],param2[=initial2],... (required)  --
  473.                  Specifies the names of the parameters whose values are to
  474.                  be determined  by  Nonlin.  Nonlin is capable of handling
  475.                  up to 12 parameters.  The parameter names may not  exceed
  476.                  10 characters  in  length.  Do not specify any parameters
  477.                  that are not  used  in  the  function.    The  PARAMETERS
  478.                  command must precede the FUNCTION command.
  479.  
  480.                  Optionally,  an  initial  estimate of the parameter value
  481.                  may be specified by following the parameter name with  an
  482.                  equal sign and the value.  If no value is specified, 1 is
  483.                  used by  default.    Specifying  an initial value that is
  484.                  near the actual value usually speeds up the operation  of
  485.  
  486.                NONLIN -- Nonlinear Regression Program      Page 11
  487.  
  488.  
  489.                  Nonlin  and  may  enable it to successfully converge to a
  490.                  solution.  If Nonlin is unable to converge to a solution,
  491.                  try   specifying   different   starting  values  for  the
  492.                  parameters.  Try to specify a value that at least has the
  493.                  correct sign as the expected final value.
  494.  
  495.                  The CONSTRAIN command (described below) can  be  used  to
  496.                  limit the  range  of  values  for  parameters.  The SWEEP
  497.                  command can be used to perform  the  regression  analysis
  498.                  with a range of parameter initial values.
  499.  
  500.          CONSTRAIN parameter=lowvalue,highvalue  (optional) -- Specifies a
  501.                  lower and upper limit on the range of a parameter  value.
  502.                  During   the   solution   process,  Nonlin  may  allow  a
  503.                  parameter's value to temporarily move in a direction away
  504.                  from its final value.  With  some  functions  it  may  be
  505.                  necessary  to  constrain the parameter's value so that it
  506.                  does not go negative (e.g., if  the  function  takes  the
  507.                  square  root of the parameter), or zero (if the parameter
  508.                  is in a denominator).
  509.  
  510.                  Only a single parameter and its associated limits may  be
  511.                  specified  on  each  CONSTRAIN  command,  but you may use
  512.                  multiple CONSTRAIN commands.  The PARAMETERS command must
  513.                  precede the CONSTRAIN command.
  514.  
  515.                  The parameter value is allowed to range  from  `lowvalue'
  516.                  to `highvalue'.  If you want to prevent a parameter value
  517.                  from going to zero, you must specify a value greater than
  518.                  zero for the low value (specifying zero would allow it to
  519.                  reach, but  not  go  below,  zero).    For  example,  the
  520.                  following command constrains the value  of  `age'  to  be
  521.                  greater than zero and less than or equal to 100:
  522.  
  523.                  CONSTRAIN age = .0001,100
  524.  
  525.                  See  the COOLING.NLR, F33EXP.NLR, and POWER.NLR files for
  526.                  examples of the CONSTRAIN command.
  527.  
  528.          SWEEP parameter=lowvalue,highvalue,stepsize  (optional)        --
  529.                  Specifies that the regression analysis is to be performed
  530.                  repeatedly   with  a  set  of  starting  values  for  the
  531.                  parameter.  The first  analysis  is  performed  with  the
  532.                  parameter  having the `lowvalue'; the value of `stepsize'
  533.                  is then added to the parameter's initial  value  and  the
  534.  
  535.                NONLIN -- Nonlinear Regression Program      Page 12
  536.  
  537.  
  538.                  analysis is  performed  again.    The process is repeated
  539.                  until the value of the parameter reaches `highvalue'.
  540.  
  541.                  Each  time  the  analysis  is  performed the value of the
  542.                  residual  sum  of  squares  is  compared  with  the  best
  543.                  previous result.   The estimated values of the parameters
  544.                  for the best starting value are saved and  used  for  the
  545.                  final analysis and report.
  546.  
  547.                  Only  one  parameter  may  be  specified  on  each  SWEEP
  548.                  command, but you may have as many SWEEP commands as there
  549.                  are parameters.    The  number  of  regression   analyses
  550.                  performed  will  be equal to the product of the number of
  551.                  parameter values for each SWEEP command.
  552.  
  553.                  The SWEEP command is useful when you are trying to fit  a
  554.                  complicated function that may have "local minimum" values
  555.                  other than  the  "global  minimum".    Periodic functions
  556.                  (sin, cos, etc.) are especially troublesome.
  557.  
  558.                  See the SINE.NLR command file for an example of the SWEEP
  559.                  command.
  560.  
  561.          FUNCTION depvar = function  (required) -- Specifies the  form  of
  562.                  the function  whose parameters are to be determined.  The
  563.                  dependent variable must be the only thing to the left  of
  564.                  the equal sign.  The expression to the right of the equal
  565.                  sign   may   contain  variables,  parameters,  constants,
  566.                  operators, and library functions such as sqrt, sin,  exp,
  567.                  etc.   The  VARIABLES  and  PARAMETERS commands must have
  568.                  appeared in the command file before the FUNCTION command,
  569.                  and all variables and parameters  used  in  the  function
  570.                  must have been specified on those commands.  Some example
  571.                  FUNCTION commands are show below:
  572.  
  573.                  FUNCTION Y = P0 + P1*X
  574.  
  575.                  FUNCTION DISTANCE = .5 * ACCEL * TIME^2
  576.  
  577.                  FUNCTION VALUE = PRICE + YRDEP*AGE + MILEDEP*MILES
  578.  
  579.                  FUNCTION POPULATN = BASE * GROWRATE * EXP(TIME)
  580.  
  581.                NONLIN -- Nonlinear Regression Program      Page 13
  582.  
  583.  
  584.          TOLERANCE value   (optional,   default=1E-10)  --  Specifies  the
  585.                  tolerance  factor  that  is  used  to  determine when the
  586.                  algorithm has converged to  a  solution.    Reducing  the
  587.                  tolerance  value  may  produce  a  slightly more accurate
  588.                  result but will increase the number of iterations and the
  589.                  running time.
  590.  
  591.          ITERATIONS value (optional, default=50) -- Specifies the  maximum
  592.                  number  of  iterations  that  should  be attempted by the
  593.                  algorithm.  If the solution  does  not  converge  to  the
  594.                  limit  specified  by  the  TOLERANCE  command  (or to the
  595.                  default  tolerance)  before   the   maximum   number   of
  596.                  iterations  is  reached,  the  process is stopped and the
  597.                  results are printed.   Failure  to  converge  before  the
  598.                  specified  number of iterations could be caused by one of
  599.                  three things:
  600.  
  601.                  1. The maximum allowed number of iterations  may  be  too
  602.                  small.   Try  using  an  ITERATIONS command with a larger
  603.                  value.
  604.  
  605.                  2. The tolerance  factor  may  be  too  small.    Even  a
  606.                  properly  converging solution will eventually "level off"
  607.                  or oscillate around a good, but non-zero, sum of  squares
  608.                  value.   Try  using the TOLERANCE command to increase the
  609.                  tolerance value.
  610.  
  611.                  3. The function may not be converging.    Try  specifying
  612.                  better  (or  at  least different) starting values for the
  613.                  parameters on the PARAMETERS command.  Consider using the
  614.                  SWEEP command to specify a range  of  parameter  starting
  615.                  values.
  616.  
  617.          REGISTER  (optional)  --  The  REGISTER  command  suppresses  the
  618.                  copyright  and  registration  message  that  is  normally
  619.                  printed as  part  of  a  Nonlin  report.  The use of this
  620.                  command is a reminder that you should register  your  use
  621.                  of Nonlin.
  622.  
  623.          OUTPUT [TO file] var1,var2,... (optional) -- Specifies that after
  624.                  the  analysis is completed, data values are to be printed
  625.                  or written to a file.  If the "TO file"  portion  of  the
  626.                  command  is  specified,  the  output  is  written  to the
  627.                  specified file.   If  this  portion  of  the  command  is
  628.                  omitted,  the  output  values  are printed along with the
  629.  
  630.                 NONLIN -- Nonlinear Regression Program      Page 14
  631.  
  632.  
  633.                  results.   If  a  file  name  is  specified  without   an
  634.                  extension, ".OUT" is used by default.
  635.  
  636.                  The list of variable names determines which variables are
  637.                  written to the file and the order  in  which  the  values
  638.                  appear in  each  output  record.  Any variable previously
  639.                  declared on a VARIABLES command may  be  specified.    In
  640.                  addition,  the folowing special variable names may appear
  641.                  in the output list:
  642.  
  643.                  $OBS -- The observation record number, starting at 1  and
  644.                  increasing by 1.
  645.  
  646.                  $PREDICTED  --  The  predicted  value  for  the dependent
  647.                  variable  for  the  observation,  given  the  independent
  648.                  variable  values  and the parameters as calculated by the
  649.                  analysis.
  650.  
  651.                  $RESIDUAL -- The difference between the actual  value  of
  652.                  the dependent variable and its predicted value.
  653.  
  654.                  Examples of OUTPUT commands are shown below:
  655.  
  656.                  OUTPUT AGE,MILES,VALUE,$PREDICTED,$RESIDUAL
  657.  
  658.                  OUTPUT TO GROWTH.DAT $OBS,TIME,POPULATN,$PREDICTED
  659.  
  660.          PLOT  [options]  -- Display a plot of the calculated function and
  661.                  the data observations.  The PLOT command may be used only
  662.                  if there  is  a  single  independent  variable  (multiple
  663.                  independent  variables  would  require  an  n-dimensional
  664.                  surface plot); however, there is no  restriction  on  the
  665.                  number of  parameters  being  estimated.  You must have a
  666.                  CGA, EGA, or VGA monitor to use the PLOT command, and the
  667.                  NONLIN.FON font file must be in the current directory  or
  668.                  in  a  directory  specified  by  the  NONLIN  environment
  669.                  variable.  In the plot, the data values you provided  are
  670.                  shown  as blue X's and the function fitted to the data by
  671.                  Nonlin is shown as a solid green line.  Press  Return  to
  672.                  proceed with the analysis after you have finished looking
  673.                  at the plot.
  674.  
  675.                NONLIN -- Nonlinear Regression Program      Page 15
  676.  
  677.  
  678.                  The  following  four options may be specified on the PLOT
  679.                  command:
  680.  
  681.                  GRID  -- display grid lines to make it easier to estimate
  682.                  values.
  683.  
  684.                  RESIDUAL -- draw vertical lines from each  observed  data
  685.                  point  to  the  corresponding  point  on  the  calculated
  686.                  function line.   These  lines  represent  the  "residual"
  687.                  value that Nonlin is attempting to minimize.
  688.  
  689.                  ITERATION  --  draw  a  plot  for  each  iteration of the
  690.                  regression analysis.  Normally, the plot is  drawn  after
  691.                  the analysis has converged to a solution; you may use the
  692.                  ITERATION  option  to  observe  the  function during each
  693.                  iteration of the analysis as  it  converges  to  fit  the
  694.                  data.
  695.  
  696.                  PRINT  --  print  a  copy  of  the plot on an HP LaserJet
  697.                  printer.  Nonlin writes the plot to the PRN device  which
  698.                  much  be  attached  to  an  HP  Series  II  or Series III
  699.                  printer.  The NONLIN.LJF font file must be in the current
  700.                  directory or in  a  directory  specified  by  the  NONLIN
  701.                  environment variable.
  702.  
  703.                  The  option  keywords  may  be abbrievated to their first
  704.                  letter.  If more than one option is  specified,  separate
  705.                  them with  commas.    For example, to produce a plot with
  706.                  both grid lines and residual  lines,  use  the  following
  707.                  command:
  708.  
  709.                      PLOT GRID,RESIDUAL
  710.  
  711.          DATA  [file]  (required)  --  Specifies  the  name  of  the  file
  712.                  containing the  data  records,  or  introduces  the  data
  713.                  records which  follow  the  command.    If a file name is
  714.                  specified on the DATA command, the file  is  opened,  its
  715.                  data  records  are  read,  and the regression analysis is
  716.                  performed.  If  a  file  name  is  specified  without  an
  717.                  extension, ".DAT" is used by default.
  718.  
  719.                  If  no  file  name  is specified on the DATA command, the
  720.                  data records must immediately follow the DATA command  in
  721.                  the command file.
  722.  
  723.                NONLIN -- Nonlinear Regression Program      Page 16
  724.  
  725.  
  726.                  Each  data  record  must  contain  at  least as many data
  727.                  values  as  the  number  of  variables  specified  on the
  728.                  VARIABLES command(s).  The  order  of  the  variables  as
  729.                  specified  on  the VARIABLES command must match the order
  730.                  of the values in  each  observation.    Any  data  values
  731.                  beyond  those  required  for  the specified variables are
  732.                  ignored.  Each observation must begin on a new line.
  733.  
  734.                  The data values must be separated by one or  more  spaces
  735.                  and/or a  comma.   Data values may contain decimal points
  736.                  and   may   be   expressed   in   exponential    notation
  737.                  (i.e., n.nnnnEppp).   As  a convenience for entering time
  738.                  values, if a value  contains  one  or  more  colons,  the
  739.                  portion  to  the  left  of the colon is multiplied by 60.
  740.                  For  example,  1:00  is  equivalent  to  60;  1:00:00  is
  741.                  equivalent to 3600.
  742.  
  743.                  You  may continue data lines by specifying a semicolon as
  744.                  the last non-blank character on a record and then placing
  745.                  the continuation value on the following line(s).
  746.  
  747.                  The DATA command must be the last command in the  command
  748.                  file.   If no file name is specified on the DATA command,
  749.                  the data records must immediately follow the DATA command
  750.                  in the command file.
  751.  
  752.                  The following is an example of a  complete  command  file
  753.                  including data records:
  754.  
  755.                  VARIABLES AGE,MILES,VALUE
  756.                  PARAMETERS BASE,DEPAGE,DEPMILES
  757.                  FUNCTION VALUE = BASE + DEPAGE*AGE + DEPMILES*MILES
  758.                  DATA
  759.                  2  10000  13000
  760.                  4  42000   9000
  761.                  1   7000  17000
  762.                  6  52000   6000
  763.                  5  48000   8000
  764.  
  765.                  If  the  data  records had been placed in a separate file
  766.                  named CAR.DAT, the DATA statement  would  be  changed  to
  767.                  "DATA CAR.DAT".
  768.  
  769.                 NONLIN -- Nonlinear Regression Program      Page 17
  770.  
  771.  
  772.          UNDERSTANDING THE RESULTS
  773.  
  774.          Nonlin prints  a  variety  of  statistics  at  the  end  of  each
  775.          analysis.   For  each  variable, Nonlin lists the mean value, the
  776.          minimum value, and the maximum value.  You  should  confirm  that
  777.          these values are within the ranges you expect.
  778.  
  779.          For   each  parameter,  Nonlin  displays  the  initial  parameter
  780.          estimate and the final estimate.  The final estimate  values  are
  781.          the results of the analysis.  By substituting these values in the
  782.          equation  you specified to be fitted to the data, you will have a
  783.          function that can be used to predict the value of  the  dependent
  784.          variable  based on a set of values for the independent variables.
  785.          For example, if the equation being fitted is
  786.  
  787.          y = p0 + p1*x
  788.  
  789.          and the final estimates are 1.5 for p0 and 3  for  p1,  then  the
  790.          equation
  791.  
  792.          y = 1.5 + 3*x
  793.  
  794.          is  the best equation of this form that will predict the value of
  795.          y based on the value of x.
  796.  
  797.          In addition to the variable and parameter values, Nonlin displays
  798.          several statistics that indicate how well the equation  fits  the
  799.          data.   The  "Final  sum of squared deviations" is the sum of the
  800.          squared differences between the actual  value  of  the  dependent
  801.          variable  for  each  observation  and  the value predicted by the
  802.          function, using the final parameter estimates.
  803.  
  804.          The "Average deviation" is the average over all  observations  of
  805.          the  absolute value of the difference between the actual value of
  806.          the dependent variable and its predicted value.
  807.  
  808.          The "Maximum  deviation  for  any  observation"  is  the  maximum
  809.          difference (ignoring sign) between the actual and predicted value
  810.          of the dependent variable for any observation.
  811.  
  812.          The  "Proportion  of variance explained (r^2)" indicates how much
  813.          better the function predicts the  dependent  variable  than  just
  814.          using the  mean  value of the dependent variable.  It is computed
  815.          as follows: Suppose that we did not fit an equation to  the  data
  816.          and  ignored  all  information about the independent variables in
  817.  
  818.                 NONLIN -- Nonlinear Regression Program      Page 18
  819.  
  820.  
  821.          each observation.  Then, the best prediction  for  the  dependent
  822.          variable value for any observation would be the mean value of the
  823.          dependent variable over all observations.  The "variance" is  the
  824.          sum  of  the  squared  differences between the mean value and the
  825.          value of the dependent variable for each observation.  Now, if we
  826.          use our fitted function to predict the  value  of  the  dependent
  827.          variable,  rather  than  using  the  mean value, a second kind of
  828.          variance can be  computed  by  taking  the  sum  of  the  squared
  829.          difference  between the value of the dependent variable predicted
  830.          by the function and the actual value.   Hopefully,  the  variance
  831.          computed  by using the values predicted by the function is better
  832.          (i.e., a smaller value) than the variance computed using the mean
  833.          value.  The "Proportion of variance  explained"  is  computed  as
  834.          1 - (variance using  predicted  value / variance using mean).  If
  835.          the function perfectly predicts the observed data, the  value  of
  836.          this statistic  will  be  1.00  (100%).   If the function does no
  837.          better a job of predicting the dependent variable than using  the
  838.          mean, the value will be 0.00.
  839.  
  840.  
  841.          THEORY OF OPERATION
  842.  
  843.          The  basis  for  the  minimization technique used by Nonlin is to
  844.          compute the sum of the squared residuals for one set of parameter
  845.          values and then slightly alter each parameter value and recompute
  846.          the sum of squared residuals  to  see  how  the  parameter  value
  847.          change affects the sum of the squared residuals.  By dividing the
  848.          difference  between  the original and new sum of squared residual
  849.          values by the amount the parameter was altered, Nonlin is able to
  850.          determine the approximate partial derivative with respect to  the
  851.          parameter.   This  partial derivative is used by Nonlin to decide
  852.          how to alter the value of the parameter for the next iteration.
  853.  
  854.          If the function being modeled is well behaved, and  the  starting
  855.          value  for  the  parameter is not too far from the optimum value,
  856.          the procedure will eventually converge to the best  estimate  for
  857.          the parameter.   This procedure is carried out simultaneously for
  858.          all parameters  and  is,  in  fact,  a  minimization  problem  in
  859.          n-dimensional space, where `n' is the number of parameters.
  860.  
  861.                 NONLIN -- Nonlinear Regression Program      Page 19
  862.  
  863.  
  864.          HINTS FOR NONLIN USE
  865.  
  866.          Convergence Failures
  867.  
  868.          One of  the  potential  problems  that  confronts  any  nonlinear
  869.          minimization    procedure    is    that    of    non-convergence.
  870.          Non-convergence is usually not a problem for regressions using  a
  871.          linear model, but becomes a more serious consideration when using
  872.          complicated   nonlinear   functions;  increasing  the  number  of
  873.          parameters aggravates the problem.
  874.  
  875.          Non-convergence can occur in two ways: the solution  may  diverge
  876.          or  it  may  converge  to  the  wrong solution -- a local minimum
  877.          rather than the global minimum.  Periodic functions, such as sin,
  878.          and cos, are particularly prone to  convergence  problems.    For
  879.          example,  consider  a  nonlinear  regression  performed  with the
  880.          function:
  881.  
  882.          y = offset + amplitude * sin(frequency * x)
  883.  
  884.          where x and y are variables, and offset, amplitude, and frequency
  885.          are the parameters whose values are to be  determined.    If  the
  886.          starting  value  for  frequency  is  not  reasonably close to the
  887.          correct value, the solution may converge to a harmonic (multiple)
  888.          or subharmonic (fundamental) value of the frequency.   A  command
  889.          file  named  SINE.NLR  is  supplied with the commands and data to
  890.          perform this analysis.
  891.  
  892.          The SWEEP command can be very  useful  in  cases  like  the  sine
  893.          example.   In  the SINE.NLR example analysis, the actual value of
  894.          the frequency  is  3;  the  function  converges  to  the  correct
  895.          solution  if  the  starting  value  is  in  the range 2.6 to 3.3.
  896.          However, this example is quite insensitive to the starting  value
  897.          of the  amplitude  parameter.    With  an  actual value of 2, the
  898.          correct solution is found with starting  values  from  1  through
  899.          10000.   Similarly,  the  offset  parameter,  which had an actual
  900.          value of 10, was successfully  determined  with  starting  values
  901.          ranging from 1 to over 50000.
  902.  
  903.          Another  example which is sensitive to a parameter starting value
  904.          is POWER.NLR which  attempts  to  determine  the  values  of  the
  905.          parameters p0, p1, and p2 for the function
  906.  
  907.          y = p0 + p1*x^p2
  908.  
  909.                NONLIN -- Nonlinear Regression Program      Page 20
  910.  
  911.  
  912.          (where "x^p2"  means x raised to the p2 power).  The actual value
  913.          of  p2 in the example data is 2; the solution converges correctly
  914.          if the starting value of p2 is in the range 1.8 to 3.8.  As  with
  915.          the  other example, the solution is relatively insensitive to the
  916.          starting values of p0 and p1.
  917.  
  918.          Singular Matrix Problems
  919.  
  920.          Another possible problem is that the analysis may stop  with  the
  921.          message "Singular  convergence.  Mutually dependent parameters?".
  922.          This is usually due  to  one  of  two  things:  (1)  a  redundant
  923.          parameter  that  is co-dependent with another parameter, or (2) a
  924.          situation where the value of one parameter "blocks" the effect of
  925.          other parameters.
  926.  
  927.          As an example of a redundant parameter, consider the function
  928.  
  929.          y = p0 + p1*p2*x
  930.  
  931.          This is a simple linear equation except there are two parameters,
  932.          p1, and p2, which are both factors to the variable x.  It  should
  933.          be  clear  that there is no unique solution to this problem since
  934.          any value of p1 is possible if the right value of p2  is  chosen.
  935.          Similarly, the function
  936.  
  937.          y = p0 + p1 + p2*x
  938.  
  939.          has no unique solution since either p0 or p1 is redundant.
  940.  
  941.          The  second type of singular matrix problem can be illustrated by
  942.          the function
  943.  
  944.          y = p0 + p1*x^p2
  945.  
  946.          If, during the solution process, p1 takes on the  value  0,  then
  947.          varying  the value of p2 has no effect on the equation and Nonlin
  948.          cannot figure out which way to change the value  of  p2  to  move
  949.          toward convergence.   The solution to this problem is to assign a
  950.          starting value that is not zero to  p1,  and  use  the  CONSTRAIN
  951.          command to force p1 to remain non-zero.
  952.  
  953.                 NONLIN -- Nonlinear Regression Program      Page 21
  954.  
  955.  
  956.          PERFORMANCE ISSUES
  957.  
  958.          Nonlin is carefully programmed and compiled  with  an  optimizing
  959.          compiler for  maximum  performance.    However,  Nonlin is a real
  960.          "number cruncher," and  the  nonlinear  regression  algorithm  is
  961.          mathematically very  elaborate.    During  each iteration, Nonlin
  962.          computes gradients, Jacobians,  Hessians,  and  eigenvalues,  and
  963.          performs QR and Cholesky matrix decompositions.  All calculations
  964.          are carried out using double precision (64 bit) floating point.
  965.  
  966.          Nonlin  does  not  require  an 80x87 numeric coprocessor, but its
  967.          performance is greatly enhanced if one is present.  In  fact,  an
  968.          8088  CPU with an 8087 numeric coprocessor can perform regression
  969.          analyses faster  than  a  20 MHz  80386  that  does  not  have  a
  970.          coprocessor.   If  you  have  an  8088  without a coprocessor, be
  971.          patient -- Nonlin is probably giving it the workout of its life.
  972.  
  973.          Very long running times can result if you use the  SWEEP  command
  974.          with many starting values.  The problem is compounded if you have
  975.          multiple SWEEP  commands.   If you use the SWEEP command to try a
  976.          large number of starting parameter values, you can save  time  by
  977.          using  the  ITERATIONS  command  to  specify  a  small  number of
  978.          iterations (such as 5) during  the  initial  attempt  to  find  a
  979.          solution.   Once  a feasible set of starting parameter values has
  980.          been determined, remove the SWEEP command, specify  the  starting
  981.          values   on  the  PARAMETERS  command,  increase  the  number  of
  982.          iterations, and rerun the analysis to get the final result.
  983.  
  984.          PROGRAM LIMITS
  985.  
  986.          The following is a summary of the Nonlin program limitations:
  987.  
  988.          Maximum number of variables = 12
  989.          Maximum number of parameters = 12
  990.          Maximum length of variable or parameter names = 10
  991.  
  992.          The maximum number of data observations that  Nonlin  can  handle
  993.          depends  on  the  number of parameters as shown by the table that
  994.          follows:
  995.  
  996.                NONLIN -- Nonlinear Regression Program      Page 22
  997.  
  998.  
  999.               # Parameters    Max Observations
  1000.                     1               2019
  1001.                     2               1611
  1002.                     3               1339
  1003.                     4               1144
  1004.                     5                997
  1005.                     6                883
  1006.                     7                791
  1007.                     8                715
  1008.                     9                652
  1009.                    10                599
  1010.  
  1011.  
  1012.          EXAMPLE ANALYSES
  1013.  
  1014.          A  number  of example regression analysis files are provided with
  1015.          your Nonlin distribution.  All of the example command files  have
  1016.          the extension  ".NLR".   Some of the important ones are described
  1017.          below, others contain comment lines that explain what they do.
  1018.  
  1019.          LINEAR.NLR -- Simple linear regression with plotted function  and
  1020.                    data.
  1021.  
  1022.          QUAD.NLR --  Fit a quadratic equation.  Plot the function and the
  1023.                    data.
  1024.  
  1025.          ASYMPTOT.NLR -- Fit an asymptotic function Y = 12 - 10/X.
  1026.  
  1027.          F33.NLR -- Multivariate linear regression.  Calculate  the  value
  1028.                    of  a used Beech F33 Bonanza airplane based on its age,
  1029.                    the number of hours on its airframe, and the number  of
  1030.                    hours on its engine.
  1031.  
  1032.          F33YEAR.NLR -- Similar to F33.NLR except the price of the Bonanza
  1033.                    is calculated  based  only on the age.  The function is
  1034.                    plotted.
  1035.  
  1036.          F33EXP.NLR  --  Similar  to   F33YEAR.NLR   except   a   negative
  1037.                    exponential  function  is  used  rather  than  a linear
  1038.                    function.
  1039.  
  1040.          SINE.NLR -- Fit an equation involving a sin function.  The  SWEEP
  1041.                    command  is  used  to  find  a starting point that will
  1042.                    converge.
  1043.  
  1044.                NONLIN -- Nonlinear Regression Program      Page 23
  1045.  
  1046.  
  1047.          COOLING.NLR -- Fit an equation involving an exponential function.
  1048.                    If  a  heated  object  is  allowed to cool, the rate of
  1049.                    cooling  at  any  instant  is   proportional   to   the
  1050.                    difference between the object's temperature and ambient
  1051.                    (room) temperature.    The  function  that  relates the
  1052.                    object's temperature to time is:
  1053.  
  1054.                    Temperature = Roomtemp+InitTemp*exp(-Coolrate*Time)
  1055.  
  1056.                    Where InitTemp  is  the  temperature  at  time  0,  and
  1057.                    Coolrate  is  a  factor that depends on the mass of the
  1058.                    object, how  well  it  is  insulated,  etc.    The  exp
  1059.                    function  is  the value of e (2.7182818...) raised to a
  1060.                    power.   The   COOLING.NLR   example   determines   the
  1061.                    parameters  InitTemp and Coolrate to fit an equation of
  1062.                    this form to some data the author collected.
  1063.  
  1064.          MAGNET.NLR -- Fit a function  involving  an  arc  tangent  and  a
  1065.                    variable to  the  third  power.  This is an interesting
  1066.                    physics problem.  If a magnet is placed due east  of  a
  1067.                    compass,  the  deflection  of  the  compass needle from
  1068.                    north is equal to the arc tangent of the ratio  of  the
  1069.                    strength  of the magnet's field relative to the earth's
  1070.                    magnetic field.  The strength of the magnet's field  at
  1071.                    the  compass  is  inversely proportional to the cube of
  1072.                    the distance from the magnet to the compass.  Thus, the
  1073.                    function relating these terms is
  1074.  
  1075.                    Deflection = deg(atan(Strength / Distance ^ 3))
  1076.  
  1077.                    The deg  function  converts  an  angle  in  radians  to
  1078.                    degrees.   In  the example, Deflection and Distance are
  1079.                    the variables, and the value of the Strength  parameter
  1080.                    is determined.
  1081.  
  1082.          DIODE.NLR -- The current through a diode increases sharply as the
  1083.                    voltage across  the  diode  is  increased.  An equation
  1084.                    that approximates the current flow as a function of the
  1085.                    voltage is:
  1086.  
  1087.                            I = a*exp(b*(V-c))
  1088.  
  1089.                    where `I' is the current, `V' is the voltage, and  `a',
  1090.                    `b', and `c' are parameters that are to be estimated by
  1091.                    the nonlinear regression.
  1092.  
  1093.                 NONLIN -- Nonlinear Regression Program      Page 24
  1094.  
  1095.  
  1096.          ACKNOWLEDGEMENT
  1097.  
  1098.          The nonlinear regression algorithm used by Nonlin  was  published
  1099.          in  ACM  Transactions  on  Mathematical Software 7,3 (Sept. 1981)
  1100.          "Dennis, J.E.,  Gay,  D.M.,  and  Welsch,  R.E.  --  An  adaptive
  1101.          nonlinear least-squares algorithm."
  1102.  
  1103.  
  1104.          USE AND DISTRIBUTION OF NONLIN
  1105.  
  1106.          Nonlin is  a "shareware" product.  You are welcome to make copies
  1107.          of this program and pass them on to friends or post this  program
  1108.          on bulletin boards.
  1109.  
  1110.          However,  if you find Nonlin to be useful and/or entertaining you
  1111.          are expected to compensate the author by sending the registration
  1112.          form printed on a following page  with  $20  to  help  cover  the
  1113.          development and  support  of Nonlin.  In return, you will receive
  1114.          the most recent version of the program along with a bound manual.
  1115.          Specify the type of disk you wish to receive.  Add $5  if  Nonlin
  1116.          is being shipped out of the United States.
  1117.  
  1118.          See  also  the  special offer that follows involving the Mathplot
  1119.          program.
  1120.  
  1121.          You are welcome to write to the author:
  1122.  
  1123.                                 Phillip H. Sherrod
  1124.                                  4410 Gerald Place
  1125.                              Nashville, TN  37205-3806
  1126.  
  1127.          Both the Nonlin program and documentation are copyright (c)  1992
  1128.          by Phillip  H.  Sherrod.    You  are not authorized to modify the
  1129.          program. "Nonlin" is a trademark.
  1130.  
  1131.          Disclaimer
  1132.  
  1133.          Nonlin is provided "as is" without warranty of any  kind,  either
  1134.          expressed or  implied.    This  program  may  contain  "bugs" and
  1135.          inaccuracies, and its results should not be assumed to be correct
  1136.          unless they are  verified  by  independent  means.    The  author
  1137.          assumes  no  responsibility for the use of Nonlin and will not be
  1138.          responsible for any damage resulting from its use.
  1139.  
  1140.                NONLIN -- Nonlinear Regression Program      Page 25
  1141.  
  1142.  
  1143.  
  1144.  
  1145.                                   M A T H P L O T
  1146.  
  1147.  
  1148.                       Mathematical Function Plotting Program
  1149.  
  1150.  
  1151.                                    Special Offer
  1152.  
  1153.  
  1154.  
  1155.          If  you like Nonlin, you should check out the Mathplot program by
  1156.          the same author.
  1157.  
  1158.          Mathplot allows you to specify complicated mathematical functions
  1159.          using ordinary algebraic expressions and immediately  plot  them.
  1160.          Four  types  of  functions  may be specified: cartesian (Y=f(X));
  1161.          parametric    cartesian    (Y=f(T)     and     X=f(T));     polar
  1162.          (Radius=f(Angle));   and   parametric   polar   (Radius=f(T)  and
  1163.          Angle=f(T)).  Up to four functions may be plotted simultaneously.
  1164.          Scaling is automatic.  Options  are  available  to  control  axis
  1165.          display and labeling as well as grid lines.  Hard copy output may
  1166.          be generated  as  well  as  screen display.  Mathplot is an ideal
  1167.          tool for engineers, scientists, math and  science  teachers,  and
  1168.          anyone   else   who   needs  to  quickly  visualize  mathematical
  1169.          functions.
  1170.  
  1171.  
  1172.          SPECIAL OFFER
  1173.  
  1174.          Registered users of Nonlin can order Mathplot for a special price
  1175.          of $18.  Or, for an even better deal, if you register Nonlin  and
  1176.          order Mathplot at the same time, you can get both for $36.
  1177.  
  1178.                 NONLIN -- Nonlinear Regression Program      Page 26
  1179.  
  1180.  
  1181.        =====================================================================
  1182.                                 Software Order Form
  1183.        =====================================================================
  1184.  
  1185.          NAME ______________________________________________________
  1186.  
  1187.          ADDRESS ___________________________________________________
  1188.  
  1189.          CITY _______________________  STATE _______ ZIP ___________
  1190.  
  1191.          TELEPHONE _________________________________________________
  1192.  
  1193.          NONLIN VERSION (on title page) ____________________________
  1194.  
  1195.          BULLETIN BOARD WHERE YOU FOUND NONLIN _____________________
  1196.  
  1197.          COMMENTS __________________________________________________
  1198.  
  1199.          Check the box below which indicates your order type:
  1200.  
  1201.          ___ I wish to register Nonlin ($20).
  1202.  
  1203.          ___ I wish to order Mathplot ($20).
  1204.  
  1205.          ___ I wish to register Nonlin and order Mathplot ($36).
  1206.  
  1207.          Add $5 to any amount shown above if the software is being shipped
  1208.          out of the United States.
  1209.  
  1210.          In return for registering,  you  will  receive  the  most  recent
  1211.          version of the program and a bound copy of the manual.
  1212.  
  1213.          Distribution disk choice (check one):
  1214.  
  1215.                3.50" HD (1.4 MB)  ______
  1216.                5.25" HD (1.2 MB)  ______
  1217.                5.25" DD (360 KB)  ______
  1218.  
  1219.          Send this form with the amount indicated to the author:
  1220.  
  1221.                                 Phillip H. Sherrod
  1222.                                  4410 Gerald Place
  1223.                              Nashville, TN  37205-3806
  1224.